import 'package:tin_flutter/generated/json/base/json_convert_content.dart';
import 'package:tin_flutter/ui/bean/response/recommend_product_entity.dart';

RecommendProductEntity $RecommendProductEntityFromJson(Map<String, dynamic> json) {
  final RecommendProductEntity recommendProductEntity = RecommendProductEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    recommendProductEntity.id = id;
  }
  final int? brandId = jsonConvert.convert<int>(json['brandId']);
  if (brandId != null) {
    recommendProductEntity.brandId = brandId;
  }
  final int? productCategoryId = jsonConvert.convert<int>(json['productCategoryId']);
  if (productCategoryId != null) {
    recommendProductEntity.productCategoryId = productCategoryId;
  }
  final int? feightTemplateId = jsonConvert.convert<int>(json['feightTemplateId']);
  if (feightTemplateId != null) {
    recommendProductEntity.feightTemplateId = feightTemplateId;
  }
  final int? productAttributeCategoryId = jsonConvert.convert<int>(
      json['productAttributeCategoryId']);
  if (productAttributeCategoryId != null) {
    recommendProductEntity.productAttributeCategoryId = productAttributeCategoryId;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    recommendProductEntity.name = name;
  }
  final String? pic = jsonConvert.convert<String>(json['pic']);
  if (pic != null) {
    recommendProductEntity.pic = pic;
  }
  final String? productSn = jsonConvert.convert<String>(json['productSn']);
  if (productSn != null) {
    recommendProductEntity.productSn = productSn;
  }
  final int? deleteStatus = jsonConvert.convert<int>(json['deleteStatus']);
  if (deleteStatus != null) {
    recommendProductEntity.deleteStatus = deleteStatus;
  }
  final int? publishStatus = jsonConvert.convert<int>(json['publishStatus']);
  if (publishStatus != null) {
    recommendProductEntity.publishStatus = publishStatus;
  }
  final int? newStatus = jsonConvert.convert<int>(json['newStatus']);
  if (newStatus != null) {
    recommendProductEntity.newStatus = newStatus;
  }
  final int? recommandStatus = jsonConvert.convert<int>(json['recommandStatus']);
  if (recommandStatus != null) {
    recommendProductEntity.recommandStatus = recommandStatus;
  }
  final int? verifyStatus = jsonConvert.convert<int>(json['verifyStatus']);
  if (verifyStatus != null) {
    recommendProductEntity.verifyStatus = verifyStatus;
  }
  final int? sort = jsonConvert.convert<int>(json['sort']);
  if (sort != null) {
    recommendProductEntity.sort = sort;
  }
  final int? sale = jsonConvert.convert<int>(json['sale']);
  if (sale != null) {
    recommendProductEntity.sale = sale;
  }
  final int? price = jsonConvert.convert<int>(json['price']);
  if (price != null) {
    recommendProductEntity.price = price;
  }
  final int? promotionPrice = jsonConvert.convert<int>(json['promotionPrice']);
  if (promotionPrice != null) {
    recommendProductEntity.promotionPrice = promotionPrice;
  }
  final int? giftGrowth = jsonConvert.convert<int>(json['giftGrowth']);
  if (giftGrowth != null) {
    recommendProductEntity.giftGrowth = giftGrowth;
  }
  final int? giftPoint = jsonConvert.convert<int>(json['giftPoint']);
  if (giftPoint != null) {
    recommendProductEntity.giftPoint = giftPoint;
  }
  final int? usePointLimit = jsonConvert.convert<int>(json['usePointLimit']);
  if (usePointLimit != null) {
    recommendProductEntity.usePointLimit = usePointLimit;
  }
  final String? subTitle = jsonConvert.convert<String>(json['subTitle']);
  if (subTitle != null) {
    recommendProductEntity.subTitle = subTitle;
  }
  final int? originalPrice = jsonConvert.convert<int>(json['originalPrice']);
  if (originalPrice != null) {
    recommendProductEntity.originalPrice = originalPrice;
  }
  final int? stock = jsonConvert.convert<int>(json['stock']);
  if (stock != null) {
    recommendProductEntity.stock = stock;
  }
  final int? lowStock = jsonConvert.convert<int>(json['lowStock']);
  if (lowStock != null) {
    recommendProductEntity.lowStock = lowStock;
  }
  final String? unit = jsonConvert.convert<String>(json['unit']);
  if (unit != null) {
    recommendProductEntity.unit = unit;
  }
  final int? weight = jsonConvert.convert<int>(json['weight']);
  if (weight != null) {
    recommendProductEntity.weight = weight;
  }
  final int? previewStatus = jsonConvert.convert<int>(json['previewStatus']);
  if (previewStatus != null) {
    recommendProductEntity.previewStatus = previewStatus;
  }
  final String? serviceIds = jsonConvert.convert<String>(json['serviceIds']);
  if (serviceIds != null) {
    recommendProductEntity.serviceIds = serviceIds;
  }
  final String? keywords = jsonConvert.convert<String>(json['keywords']);
  if (keywords != null) {
    recommendProductEntity.keywords = keywords;
  }
  final String? note = jsonConvert.convert<String>(json['note']);
  if (note != null) {
    recommendProductEntity.note = note;
  }
  final String? albumPics = jsonConvert.convert<String>(json['albumPics']);
  if (albumPics != null) {
    recommendProductEntity.albumPics = albumPics;
  }
  final String? detailTitle = jsonConvert.convert<String>(json['detailTitle']);
  if (detailTitle != null) {
    recommendProductEntity.detailTitle = detailTitle;
  }
  final String? promotionStartTime = jsonConvert.convert<String>(json['promotionStartTime']);
  if (promotionStartTime != null) {
    recommendProductEntity.promotionStartTime = promotionStartTime;
  }
  final String? promotionEndTime = jsonConvert.convert<String>(json['promotionEndTime']);
  if (promotionEndTime != null) {
    recommendProductEntity.promotionEndTime = promotionEndTime;
  }
  final int? promotionPerLimit = jsonConvert.convert<int>(json['promotionPerLimit']);
  if (promotionPerLimit != null) {
    recommendProductEntity.promotionPerLimit = promotionPerLimit;
  }
  final int? promotionType = jsonConvert.convert<int>(json['promotionType']);
  if (promotionType != null) {
    recommendProductEntity.promotionType = promotionType;
  }
  final String? brandName = jsonConvert.convert<String>(json['brandName']);
  if (brandName != null) {
    recommendProductEntity.brandName = brandName;
  }
  final String? productCategoryName = jsonConvert.convert<String>(json['productCategoryName']);
  if (productCategoryName != null) {
    recommendProductEntity.productCategoryName = productCategoryName;
  }
  return recommendProductEntity;
}

Map<String, dynamic> $RecommendProductEntityToJson(RecommendProductEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['brandId'] = entity.brandId;
  data['productCategoryId'] = entity.productCategoryId;
  data['feightTemplateId'] = entity.feightTemplateId;
  data['productAttributeCategoryId'] = entity.productAttributeCategoryId;
  data['name'] = entity.name;
  data['pic'] = entity.pic;
  data['productSn'] = entity.productSn;
  data['deleteStatus'] = entity.deleteStatus;
  data['publishStatus'] = entity.publishStatus;
  data['newStatus'] = entity.newStatus;
  data['recommandStatus'] = entity.recommandStatus;
  data['verifyStatus'] = entity.verifyStatus;
  data['sort'] = entity.sort;
  data['sale'] = entity.sale;
  data['price'] = entity.price;
  data['promotionPrice'] = entity.promotionPrice;
  data['giftGrowth'] = entity.giftGrowth;
  data['giftPoint'] = entity.giftPoint;
  data['usePointLimit'] = entity.usePointLimit;
  data['subTitle'] = entity.subTitle;
  data['originalPrice'] = entity.originalPrice;
  data['stock'] = entity.stock;
  data['lowStock'] = entity.lowStock;
  data['unit'] = entity.unit;
  data['weight'] = entity.weight;
  data['previewStatus'] = entity.previewStatus;
  data['serviceIds'] = entity.serviceIds;
  data['keywords'] = entity.keywords;
  data['note'] = entity.note;
  data['albumPics'] = entity.albumPics;
  data['detailTitle'] = entity.detailTitle;
  data['promotionStartTime'] = entity.promotionStartTime;
  data['promotionEndTime'] = entity.promotionEndTime;
  data['promotionPerLimit'] = entity.promotionPerLimit;
  data['promotionType'] = entity.promotionType;
  data['brandName'] = entity.brandName;
  data['productCategoryName'] = entity.productCategoryName;
  return data;
}

extension RecommendProductEntityExtension on RecommendProductEntity {
  RecommendProductEntity copyWith({
    int? id,
    int? brandId,
    int? productCategoryId,
    int? feightTemplateId,
    int? productAttributeCategoryId,
    String? name,
    String? pic,
    String? productSn,
    int? deleteStatus,
    int? publishStatus,
    int? newStatus,
    int? recommandStatus,
    int? verifyStatus,
    int? sort,
    int? sale,
    int? price,
    int? promotionPrice,
    int? giftGrowth,
    int? giftPoint,
    int? usePointLimit,
    String? subTitle,
    int? originalPrice,
    int? stock,
    int? lowStock,
    String? unit,
    int? weight,
    int? previewStatus,
    String? serviceIds,
    String? keywords,
    String? note,
    String? albumPics,
    String? detailTitle,
    String? promotionStartTime,
    String? promotionEndTime,
    int? promotionPerLimit,
    int? promotionType,
    String? brandName,
    String? productCategoryName,
  }) {
    return RecommendProductEntity()
      ..id = id ?? this.id
      ..brandId = brandId ?? this.brandId
      ..productCategoryId = productCategoryId ?? this.productCategoryId
      ..feightTemplateId = feightTemplateId ?? this.feightTemplateId
      ..productAttributeCategoryId = productAttributeCategoryId ?? this.productAttributeCategoryId
      ..name = name ?? this.name
      ..pic = pic ?? this.pic
      ..productSn = productSn ?? this.productSn
      ..deleteStatus = deleteStatus ?? this.deleteStatus
      ..publishStatus = publishStatus ?? this.publishStatus
      ..newStatus = newStatus ?? this.newStatus
      ..recommandStatus = recommandStatus ?? this.recommandStatus
      ..verifyStatus = verifyStatus ?? this.verifyStatus
      ..sort = sort ?? this.sort
      ..sale = sale ?? this.sale
      ..price = price ?? this.price
      ..promotionPrice = promotionPrice ?? this.promotionPrice
      ..giftGrowth = giftGrowth ?? this.giftGrowth
      ..giftPoint = giftPoint ?? this.giftPoint
      ..usePointLimit = usePointLimit ?? this.usePointLimit
      ..subTitle = subTitle ?? this.subTitle
      ..originalPrice = originalPrice ?? this.originalPrice
      ..stock = stock ?? this.stock
      ..lowStock = lowStock ?? this.lowStock
      ..unit = unit ?? this.unit
      ..weight = weight ?? this.weight
      ..previewStatus = previewStatus ?? this.previewStatus
      ..serviceIds = serviceIds ?? this.serviceIds
      ..keywords = keywords ?? this.keywords
      ..note = note ?? this.note
      ..albumPics = albumPics ?? this.albumPics
      ..detailTitle = detailTitle ?? this.detailTitle
      ..promotionStartTime = promotionStartTime ?? this.promotionStartTime
      ..promotionEndTime = promotionEndTime ?? this.promotionEndTime
      ..promotionPerLimit = promotionPerLimit ?? this.promotionPerLimit
      ..promotionType = promotionType ?? this.promotionType
      ..brandName = brandName ?? this.brandName
      ..productCategoryName = productCategoryName ?? this.productCategoryName;
  }
}